package com.gz.rabbitmq.listern;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class MqListen {


    @RabbitListener(queues = "springboot-rabbitMq-queue")
    public void listen(String msg) {
        System.out.println("接收到消息："+msg);
    }

    @RabbitListener(queues = "queue_ttl")
    public void listenTTL(String msg){
        System.out.println("过期时间内接受的消息："+msg);
    }
}
